package com.semidata.rtd.core.job;

import com.semidata.rtd.core.executor.TaskExecutor;

public class Task3 extends ScheduledTask<Void, TestContext> {

    private TestContext context;

    public Task3(Job<TestContext> job, TaskExecutor executor) {
        super(job, executor);
        context = getJob().getJobContext();
    }

    @Override
    public Void run() {
        System.out.println(context.getValue());
        context.setValue(this.toString());
        return null;
    }

    @Override
    protected void done(Void result, Throwable cause) {
        if (cause != null) {
            cause.printStackTrace();
            context.setCause(cause);
        }
    }

}
